﻿@{
    Layout = null;
}
<style type="text/css">
    ul {
        list-style: none;
        padding-left: 0px;
    }

    .uploadpic > li:first-child {
        background: url(/Content/img/camera-upload.png) no-repeat center;
    }

    .control-label {
        max-width: 130px;
    }

    .uploadpic > li {
        display: inline-block;
        position: relative;
        display: inline-block;
        border-radius: 4px;
        overflow: hidden;
        color: #1E88C7;
        text-decoration: none;
        text-indent: 0;
        line-height: 20px;
        height: 50px;
        width: 50px;
        margin-right: 10px;
    }

    .file {
        position: relative;
        display: inline-block;
        border-radius: 4px;
        overflow: hidden;
        color: #1E88C7;
        text-decoration: none;
        text-indent: 0;
        line-height: 20px;
        height: 50px;
        width: 50px;
    }

        .file input {
            position: absolute;
            right: 0;
            top: 0;
            opacity: 0;
            width: 50px;
            height: 50px;
        }

    #PreviewImg {
        display: inline-block;
        width: 50px;
        height: 50px;
    }
</style>

<div class="panel-body" style="padding:0">
    <div class="panel panel-default">
        <div class="panel-heading"></div>
        <div class="panel-body">
            <form id="formSearch" class="form-horizontal">
                <div class="form-group">
                    @if (string.IsNullOrEmpty(ViewBag.MerchantId))
                    {
                        <p style="color:red;font-size:20px;margin-left:30px;">该商户还未配置店铺信息，不允许操作菜品管理，请您首先配置商户信息</p>
                    }
                </div>
                <div class="form-group">
                    <label class="control-label" for="name_search">菜品名称:</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" id="name_search" placeholder="请输入菜品名称">
                    </div>
                    <label class="control-label" for="ualmark_search">上下架:</label>
                    <div class="col-sm-2">
                        <select class="form-control" id="ualmark_search">
                            <option value="-1">全部</option>
                            <option value="0">未上架</option>
                            <option value="1">已上架</option>
                        </select>
                    </div>
                    <div class="col-sm-3">
                        <button type="button" id="btnQueryList" class="btn btn-primary"><i class="fa fa-search"></i>查询</button>
                        <button type="button" id="btnReset" class="btn btn-primary"><i class="fa fa-remove"></i>清空</button>
                    </div>
                </div>
            </form>
            <hr />
            <div>
                <table id="productuserinfo"></table>
            </div>
        </div>
    </div>
</div>

<div id="toolbar" class="btn-group">
    <button id="btnAddDialog" type="button" class="btn btn-primary"><span><i class="fa fa-edit"></i>&nbsp;添加</span></button>
    <button id="btnEditDialog" type="button" class="btn btn-primary"><span><i class="fa fa-book"></i>&nbsp;修改</span></button>
    <button id="btnYesUalMarkDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;上架</span></button>
    <button id="btnNoUalMarkDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;下架</span></button>
    <button id="btnDelDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;删除</span></button>
    <button id="btnDeltailDialog" type="button" class="btn btn-primary"><span><i class="fa fa-remove"></i>&nbsp;详情</span></button>
</div>

@*添加修改菜品模型*@
<div class="modal fade" id="AddProductModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width:50%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title" id="HeadTitle">添加菜品</h4>
            </div>
            <div class="modal-body">
                <form id="ProductOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="Id" name="Id" />
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">商户名称:</span>
                            <input type="text" class="form-control" value="@ViewBag.MerchantName" readonly="readonly" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">菜品名称:</span>
                            <input type="text" id="Name" name="Name" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">菜品分类:</span>
                            <select id="CategoryId" name="CategoryId" class="selectpicker show-tick form-control" data-live-search="true"></select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">原价:</span>
                            <input type="text" id="OriginalPrice" name="OriginalPrice" class="form-control" />
                            <span class="input-group-addon">折扣价:</span>
                            <input type="text" id="DiscountPrice" name="DiscountPrice" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">说明:</span>
                            <input type="text" id="Description" name="Description" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">标签:</span>
                            <input type="text" id="Tag" name="Tag" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">大小中份:</span>
                            <select class="form-control" id="Type" name="Type">
                                <option value="4">其他</option>
                                <option value="1">大</option>
                                <option value="2">中</option>
                                <option value="3">小</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">是否限购:</span>
                            <select class="form-control" id="IsLimitPurchase" name="IsLimitPurchase">
                                <option value="0">不限购</option>
                                <option value="1">限购</option>
                            </select>
                            <span class="input-group-addon">限购份数:</span>
                            <input type="text" id="LimitPurchaseCopies" name="LimitPurchaseCopies" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">预览图:</span>
                            <div class="col-sm-10 camera">
                                <ul class="uploadpic">
                                    <li>
                                        <a href="javascript:void(0);" class="file">
                                            <input type="file" id="file" name="file" class="btnupload" />
                                        </a>
                                    </li>
                                    <li>
                                        <img src="" id="PreviewImg" />
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnAddOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@* 上下架模型 *@
<div class="modal fade" id="UalMarkModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title">菜品(<span id="productName">***</span>)上下架管理</h4>
            </div>
            <div class="modal-body">
                <form id="ualMarkOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="ualMark_id" name="ualMark_id" />
                    <div class="form-group">
                        <div class="input-group">
                            您确认要<span id="productName_OK">***</span>吗？
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnUalMarkOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@*删除菜品信息*@
<div class="modal fade" id="DeleteModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title">菜品：(<span id="Delete_Head_Title">***</span>)删除确认页面</h4>
            </div>
            <div class="modal-body">
                <form id="DeleteOperation" method="post" class="form-horizontal">
                    <input type="hidden" id="delete_id" name="delete_id" />
                    <div class="form-group">
                        <div class="input-group">
                            您确认要删除菜品（<span id="Delete_Head_Title_OK">***</span>)吗？
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-reply"></i>取消</button>
                <button type="button" class="btn btn-primary" id="btnDeleteOK"><i class="fa fa-check"></i>确定</button>
            </div>
        </div>
    </div>
</div>

@*菜品详情*@
<div class="modal fade" id="DetailModal" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width:50%;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> &times;</button>
                <h4 class="modal-title">菜品信息详情</h4>
            </div>
            <div class="modal-body">
                <form id="ProductDetail" class="form-horizontal">
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">菜品分类:</span>
                            <input type="text" id="detail_platformname" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">商户名称:</span>
                            <input type="text" id="detail_merchantname" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">名称:</span>
                            <input type="text" id="detail_name" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">销量:</span>
                            <input type="text" id="detail_salesvolume" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">原价:</span>
                            <input type="text" id="detail_originalprice" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">折扣价:</span>
                            <input type="text" id="detail_discountprice" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">好评率:</span>
                            <input type="text" id="detail_praiserate" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">说明:</span>
                            <input type="text" id="detail_description" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">标签:</span>
                            <input type="text" id="detail_tag" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">大中小份:</span>
                            <input type="text" id="detail_type" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">是否限购:</span>
                            <input type="text" id="detail_islimitpurchase" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">限购份数:</span>
                            <input type="text" id="detail_limitpurchasecopies" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">上下架:</span>
                            <input type="text" id="detail_ualmark" readonly="readonly" class="form-control" />
                            <span class="input-group-addon">创建时间:</span>
                            <input type="text" id="detail_createtime" readonly="readonly" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="input-group">
                            <span class="input-group-addon">预览图:</span>
                            <div style="float: left;border: 1px solid #CAC3C3;background: #FFFFFF;margin-left: 20px;box-shadow: 5px 5px 5px #777575;">
                                <img id="detail_previewimg" style="width:120px;height:80px" />
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script src="~/Scripts/project/min/productuser.min.js"></script>
<script type="text/javascript">
    $(function () {
        ml.admin.productuser.init({
            "MerchantId": "@ViewBag.MerchantId"
        });
    });
</script>